{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:26.831051Z",
     "start_time": "2024-03-30T23:39:23.276549Z"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "pd.options.display.float_format = '{:,.5f}'.format\n",
    "\n",
    "from pandapower.plotting import simple_plot\n",
    "from pandapower.shortcircuit.calc_sc import calc_sc\n",
    "from pandapower.create import create_empty_network, create_bus, create_ext_grid, create_transformer3w_from_parameters"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:26.831051Z",
     "start_time": "2024-03-30T23:39:23.276549Z"
    }
   },
   "outputs": [],
   "source": [
    "def single_3w_trafo_grid(vector_group, sn_mva=123):\n",
    "    net = create_empty_network(sn_mva=sn_mva)\n",
    "    b1 = create_bus(net, vn_kv=380., geodata=(1, 1))\n",
    "    b2 = create_bus(net, vn_kv=110., geodata=(0, 1))\n",
    "    b3 = create_bus(net, vn_kv=30., geodata=(1, 0))\n",
    "    create_ext_grid(net, b1, s_sc_max_mva=1000, s_sc_min_mva=800, rx_max=0.1, x0x_max=1, r0x0_max=0.1, rx_min=0.1,\n",
    "                    x0x_min=1, r0x0_min=0.1)\n",
    "\n",
    "    create_transformer3w_from_parameters(net, hv_bus=b1, mv_bus=b2, lv_bus=b3, vn_hv_kv=400, vn_mv_kv=120, vn_lv_kv=30,\n",
    "                                         sn_hv_mva=350, sn_mv_mva=350, sn_lv_mva=50, pfe_kw=0, i0_percent=0,\n",
    "                                         vk_hv_percent=21, vkr_hv_percent=.26, vk_mv_percent=7, vkr_mv_percent=.16,\n",
    "                                         vk_lv_percent=10., vkr_lv_percent=.16, vk0_hv_percent=44.1,\n",
    "                                         vkr0_hv_percent=0.26, vk0_mv_percent=6.2996, vkr0_mv_percent=0.03714,\n",
    "                                         vk0_lv_percent=6.2996, vkr0_lv_percent=0.03714, vector_group=vector_group)\n",
    "    return net"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:26.837253Z",
     "start_time": "2024-03-30T23:39:26.834035Z"
    }
   },
   "outputs": [],
   "source": [
    "# beauftragt: Y0y0d5, YN0y0d5, Y0yn0d5, YN0yn0d5, Y0y0y0, Y0d5d5, YN0d5d5, Y0d5y0, Y0y0d11 und D0d0d0 \n",
    "# implementiert zusätzlich: YNdy, Ydyn, YNdyn, YNyy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:26.896786Z",
     "start_time": "2024-03-30T23:39:26.838329Z"
    }
   },
   "outputs": [],
   "source": [
    "vg = \"yyy\"\n",
    "net = single_3w_trafo_grid(vg)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:27.057796Z",
     "start_time": "2024-03-30T23:39:26.898800Z"
    }
   },
   "outputs": [],
   "source": [
    "simple_plot(net, ext_grid_size=5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:28.728039Z",
     "start_time": "2024-03-30T23:39:27.058805Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"Yyy\")\n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:28.740814Z",
     "start_time": "2024-03-30T23:39:28.730053Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:28.821936Z",
     "start_time": "2024-03-30T23:39:28.742606Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"Ydd\")\n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:28.832169Z",
     "start_time": "2024-03-30T23:39:28.823073Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:28.919184Z",
     "start_time": "2024-03-30T23:39:28.833158Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"Ddd\")\n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:28.933415Z",
     "start_time": "2024-03-30T23:39:28.923169Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.026189Z",
     "start_time": "2024-03-30T23:39:28.935408Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"Yynd\")\n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.037081Z",
     "start_time": "2024-03-30T23:39:29.028198Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.127456Z",
     "start_time": "2024-03-30T23:39:29.039080Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"Ydyn\")  # Extra vector group\n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.138548Z",
     "start_time": "2024-03-30T23:39:29.129469Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.242692Z",
     "start_time": "2024-03-30T23:39:29.140543Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNynd\")\n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.257054Z",
     "start_time": "2024-03-30T23:39:29.244810Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.368422Z",
     "start_time": "2024-03-30T23:39:29.258160Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNdyn\")  # Extra vector group\n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.380999Z",
     "start_time": "2024-03-30T23:39:29.370437Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.483326Z",
     "start_time": "2024-03-30T23:39:29.383016Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNyd\")\n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.495096Z",
     "start_time": "2024-03-30T23:39:29.484338Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.590956Z",
     "start_time": "2024-03-30T23:39:29.496106Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNdy\")  # Extra vector group\n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.602393Z",
     "start_time": "2024-03-30T23:39:29.592968Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.708673Z",
     "start_time": "2024-03-30T23:39:29.603391Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNdd\")\n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.721244Z",
     "start_time": "2024-03-30T23:39:29.710690Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.840707Z",
     "start_time": "2024-03-30T23:39:29.723258Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNyy\")  # Extra vector group\n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:29.854031Z",
     "start_time": "2024-03-30T23:39:29.842704Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)  # warum dasselbe Ergebnis wie Yyy?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Single-bus fault"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "all-bus fault vs single-bus fault vs LU factorization"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ynynd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.077108Z",
     "start_time": "2024-03-30T23:39:29.855926Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"Ynynd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.096432Z",
     "start_time": "2024-03-30T23:39:30.085182Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.204778Z",
     "start_time": "2024-03-30T23:39:30.098446Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"Ynynd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\", bus=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.219950Z",
     "start_time": "2024-03-30T23:39:30.206744Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.340774Z",
     "start_time": "2024-03-30T23:39:30.222984Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "# now with LU factorization instead of Y inversion\n",
    "net = single_3w_trafo_grid(\"Ynynd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\", bus=0, inverse_y=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.355680Z",
     "start_time": "2024-03-30T23:39:30.342811Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.464411Z",
     "start_time": "2024-03-30T23:39:30.357692Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "# now with LU factorization instead of Y inversion\n",
    "net = single_3w_trafo_grid(\"Ynynd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\", bus=1, inverse_y=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.476434Z",
     "start_time": "2024-03-30T23:39:30.466426Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.583181Z",
     "start_time": "2024-03-30T23:39:30.478447Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "# now with LU factorization instead of Y inversion\n",
    "net = single_3w_trafo_grid(\"Ynynd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\", bus=2, inverse_y=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.595832Z",
     "start_time": "2024-03-30T23:39:30.585193Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ydd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.706810Z",
     "start_time": "2024-03-30T23:39:30.596844Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"Ydd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.722321Z",
     "start_time": "2024-03-30T23:39:30.708824Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.848396Z",
     "start_time": "2024-03-30T23:39:30.724283Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"Ydd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\", bus=0, inverse_y=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.862671Z",
     "start_time": "2024-03-30T23:39:30.850391Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.972483Z",
     "start_time": "2024-03-30T23:39:30.864684Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"Ydd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\", bus=1, inverse_y=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:30.985449Z",
     "start_time": "2024-03-30T23:39:30.974495Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.121024Z",
     "start_time": "2024-03-30T23:39:30.986463Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"Ydd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\", bus=2, inverse_y=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.137500Z",
     "start_time": "2024-03-30T23:39:31.123064Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## YNyd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.269076Z",
     "start_time": "2024-03-30T23:39:31.140340Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNyd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.282373Z",
     "start_time": "2024-03-30T23:39:31.271090Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.412232Z",
     "start_time": "2024-03-30T23:39:31.284383Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNyd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\", bus=0, inverse_y=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.429355Z",
     "start_time": "2024-03-30T23:39:31.414245Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.541083Z",
     "start_time": "2024-03-30T23:39:31.431371Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNyd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\", bus=1, inverse_y=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.554596Z",
     "start_time": "2024-03-30T23:39:31.542078Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.667552Z",
     "start_time": "2024-03-30T23:39:31.556612Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNyd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\", bus=2, inverse_y=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.680527Z",
     "start_time": "2024-03-30T23:39:31.669953Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## YNdd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.792388Z",
     "start_time": "2024-03-30T23:39:31.682538Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNdd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.807739Z",
     "start_time": "2024-03-30T23:39:31.794399Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.949699Z",
     "start_time": "2024-03-30T23:39:31.809752Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNdd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\", bus=0, inverse_y=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:31.986344Z",
     "start_time": "2024-03-30T23:39:31.951695Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:32.119098Z",
     "start_time": "2024-03-30T23:39:31.988392Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNdd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\", bus=1, inverse_y=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:32.130783Z",
     "start_time": "2024-03-30T23:39:32.121109Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:32.238871Z",
     "start_time": "2024-03-30T23:39:32.132794Z"
    }
   },
   "outputs": [],
   "source": [
    "%%capture\n",
    "net = single_3w_trafo_grid(\"YNdd\")  \n",
    "calc_sc(net, fault=\"1ph\", case=\"max\", bus=2, inverse_y=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-30T23:39:32.250262Z",
     "start_time": "2024-03-30T23:39:32.239867Z"
    }
   },
   "outputs": [],
   "source": [
    "display(net.res_bus_sc)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For further vector groups, we included the check in the test, all the vector groups passed."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
